﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Easyui扩展库 Tabs - 落阳 整理</title>
    <link href="http://www.easyui-extlib.com/Content/Site.css" rel="stylesheet" />
    <script src="http://www.easyui-extlib.com/Scripts/jquery/jquery-1.11.0.min.js"></script>
    <script src="http://www.easyui-extlib.com/Scripts/jquery-extensions/jquery.jdirk.js"></script>
    <link href="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/themes/default/easyui.css" rel="stylesheet" />
    <link href="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" />
    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>

    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui-extensions/tabs/jeasyui.extensions.tabs.tabState.js"></script>
    <script>
        $(function () {

            $("#btnCheckIsSelected").click(function () {
                var tabs = $("#tabs1");
                var opts = tabs.tabs("isSelected", "标签页3");
                alert("标签页3" + (opts ? "已经" : "没有") + "被选择");
            });

            $("#btnCheckIsClosable2").click(function () {
                var tabs = $("#tabs1");
                var opts = tabs.tabs("isClosable", "标签页2");
                alert("标签页2" + (opts ? "可以" : "无法") + "被关闭");
            });

            $("#btnCheckIsClosable3").click(function () {
                var tabs = $("#tabs1");
                var opts = tabs.tabs("isClosable", "标签页3");
                alert("标签页3" + (opts ? "可以" : "无法") + "被关闭");
            });

            $("#btnCheckIsDisabled").click(function () {
                var tabs = $("#tabs1");
                var opts = tabs.tabs("isDisabled", "标签页1");
                alert("标签页1" + (opts ? "已经" : "没有") + "被禁用");
            });

            $("a[id^='btnDisableTab']").click(function () {
                var id = $(this).attr("id"), order = id.split("_")[1];
                $("#tabs1").tabs("disableTab", "标签页" + order);
            });

        });
    </script>
</head>
<body>
    <div class="easyui-layout" data-options="fit:true">
        <div data-options="region:'north',border:false,title:'北部'" style="height:100px;border-bottom-width:1px;padding:25px;">
            <a id="btnCheckIsSelected" class="easyui-linkbutton" data-options="iconCls:'icon-add'">判断标签页3是否已被选择</a>
            <a id="btnCheckIsClosable2" class="easyui-linkbutton" data-options="iconCls:'icon-add'">判断标签页2是否可关闭</a>
            <a id="btnCheckIsClosable3" class="easyui-linkbutton" data-options="iconCls:'icon-add'">判断标签页3是否可关闭</a>
            <a id="btnCheckIsDisabled" class="easyui-linkbutton" data-options="iconCls:'icon-add'">判断标签页1是否被禁用</a>
        </div>
        <div data-options="region:'center',border:false,title:'中间'">
            <div id="tabs1" class="easyui-tabs" data-options="fit:true,border:false">
                <div data-options="title:'标签页1',closable:false,iconCls:'icon-add'" style="padding:15px;">
                    标签页1
                    <br />
                    <a id="btnDisableTab_1" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">禁用当前标签页</a>
                </div>
                <div data-options="title:'标签页2',closable:true,iconCls:'icon-edit',selected:true" style="padding:15px;">
                    标签页2
                    <br />
                    <a id="btnDisableTab_2" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">禁用当前标签页</a>
                </div>
                <div data-options="title:'标签页3',closable:false,iconCls:'icon-remove'" style="padding:15px;">
                    标签页3
                    <br />
                    <a id="btnDisableTab_3" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">禁用当前标签页</a>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
